

#ifndef COMPANYDAO_STRUCT_H
#define COMPANYDAO_STRUCT_H

#include <stdint.h>
#include <string>
#include <iostream>
#include "libc2c/byte_stream.h"
#include "app_platform/intf_service_object.h"
#include <set>	
#include "erp/company/ddo/companyinfoddo_company.h"	
#include <map>	
#include "erp/company/ddo/companyfilterddo_company.h"	
#include <vector>	

namespace erp
{
namespace company
{
namespace dao
{

	const uint32_t COMPANYDAO_ADDANDUPDATECOMPANY_REQ_CMD_ID = 0xc0661803; /// 请求命令号
	const uint32_t COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID = 0xc0668803; /// 回应命令号
	

	const uint32_t COMPANYDAO_DELETECOMPANY_REQ_CMD_ID = 0xc0661804; /// 请求命令号
	const uint32_t COMPANYDAO_DELETECOMPANY_RESP_CMD_ID = 0xc0668804; /// 回应命令号
	

	const uint32_t COMPANYDAO_GETCOMPANY_REQ_CMD_ID = 0xc0661802; /// 请求命令号
	const uint32_t COMPANYDAO_GETCOMPANY_RESP_CMD_ID = 0xc0668802; /// 回应命令号
	

	const uint32_t COMPANYDAO_GETCOMPANYBYIDS_REQ_CMD_ID = 0xc0661801; /// 请求命令号
	const uint32_t COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID = 0xc0668801; /// 回应命令号
	


const uint16_t COMPANYDAO_MAX_PROTOCAL_VERSION = 2; //>平台支持的最大协议版本号


///////////////////////////// STRUCTS /////////////////////////////////////////////////
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoAddAndUpdateCompanyReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::company::ddo::CCompanyInfoDdo companyInfo;	
		std::string inReserve;
		std::string errmsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_ADDANDUPDATECOMPANY_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			companyInfo.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoAddAndUpdateCompanyResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_ADDANDUPDATECOMPANY_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & outReserve;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoDeleteCompanyReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::company::ddo::CCompanyInfoDdo companyInfo;	
		std::string inReserve;
		std::string errmsg;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_DELETECOMPANY_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			companyInfo.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoDeleteCompanyResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_DELETECOMPANY_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & outReserve;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoGetCompanyReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		erp::company::ddo::CCompanyFilterDdo companyFilter;	
		std::string inReserve;
		std::string errmsg;
		std::vector<erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANY_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			companyFilter.Serialize(bs);
			bs & inReserve;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoGetCompanyResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::vector<erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANY_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & companyInfo;
			bs & outReserve;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoGetCompanyByIdsReq : public IServiceObject, public ISerializableXML
	{
		std::string machineKey;
		std::string source;
		uint32_t sceneId;
		std::set<uint32_t > companysysNoList;
		std::string inReserve;
		std::string errmsg;
		std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
	
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANYBYIDS_REQ_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
			//检查协议的版本号
		    //if(bs.getVersion() > COMPANYDAO_MAX_PROTOCAL_VERSION)
		    //    return false;
			bs & machineKey;
			bs & source;
			bs & sceneId;
			bs & companysysNoList;
			bs & inReserve;
		    return bs.isGood();
		}
		
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};
	
	/**
	 *
 	 * 
	 *
 	 * @date 2013-10-25 10:16:19
 	 * @version 0
	 */	
	struct CCompanyDaoGetCompanyByIdsResp : public IServiceObject, public ISerializableXML
	{
		uint32_t dwResult;
		std::string errmsg;
		std::map<uint32_t,erp::company::ddo::CCompanyInfoDdo > companyInfo;
		std::string outReserve;
		
	    virtual uint32_t getCmdId() const { return COMPANYDAO_GETCOMPANYBYIDS_RESP_CMD_ID; }
		virtual bool Serialize(CByteStreamNetwork& bs)
		{
		    bs & dwResult;
			bs & errmsg;
			bs & companyInfo;
			bs & outReserve;

		    return bs.isGood();
		}
	    virtual void Dump(std::ostream& os)	{}
	
		virtual bool FromXML(const std::string& sXMLContent) { return true; }
		virtual bool ToXML(std::string& sXMLContent) { return true; }
	};	

}
}
}

#endif /* COMPANYDAO_STRUCT_H */

